class MobileClient {
  
 String address;
 String name;
 String lastCommand;
 String command;
 String clientStatus;
 String action;
  
}


MobileClient[] append(MobileClient[] mobileClients,MobileClient newMobileClient)  
{  
  MobileClient tempMobileClient[] = new MobileClient[mobileClients.length+1];  
  System.arraycopy(mobileClients,0,tempMobileClient,0,mobileClients.length);
  tempMobileClient[mobileClients.length] = newMobileClient;  
  return tempMobileClient;  
}

MobileClient[] pop(MobileClient[] mobileClients, MobileClient oldMobileClient)
{
  
  MobileClient tempMobileClient[] = new MobileClient[mobileClients.length-1];  
  
  int j  = 0;
  
  for(int i = 0; i < mobileClients.length; i++)
    if(!mobileClients[i].address.equals(oldMobileClient.address)) {
      tempMobileClient[j] = mobileClients[i];
      j++;
    }
  
  return tempMobileClient;

}

MobileClient findMobileClient(MobileClient[] mobileClients, String address) {
    
    for(int i = 0; i < mobileClients.length; i++) {
      if(address.equals(mobileClients[i].address)) return mobileClients[i];
    }
    
    return null;
    
}
